<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Conditional Assembly</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../edit68k.css" rel="stylesheet" type="text/css">
</head>

<body class="text">
<p class="heading">Assembler Commands - Conditional Assembly<hr noshade></p>
<p></p>
<p>
Conditional assembly is supported in all code areas including macros. 
The assembler recognizes two different conditional statements. One syntax 
compares the equality of two strings and has the form:
<p class="sourcecode">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IFxx <i>string1</i>,<i>string2</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <i>code</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDC </p>
The condition xx is either C or NC. IFC means if compare (the 
strings are equal). IFNC means if not compare (the strings are not equal). If 
the condition is true the following code is included in the program.<br>
<br>
Another syntax compares an expression against zero and has the form:<br>
<p class="sourcecode">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IFxx <i>
expression</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <i>code</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDC</p>
<p class="text2">The condition xx is either: <br>
&nbsp;EQ (expression = 0)<br>
&nbsp;NE (expression &lt;&gt; 0)<br>
&nbsp;LT (expression &lt; 0)<br>
&nbsp;LE (expression &lt;= 0)<br>
&nbsp;GT (expression &gt; 0)<br>
&nbsp;GE (expression &gt;= 0)<br>
<br>
The expression is compared with 0. If the condition is true the following code 
is included in the program.
</p>
<p>The expression must be absolute, no forward references are 
allowed.
IFxx and ENDC directives may not be labeled.<br>
<br>
Conditional assembly may be used to temporarily add or remove code. In the 
following example, debug code may be included during assembly by changing the 0 
to a 1.</p>
<p class="sourcecode">debug&nbsp;&nbsp; equ&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
set to 1 to include debug code<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ifne&nbsp; debug<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <i>debug code goes here</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endc</p>
<p>Refer to the Examples folder for additional sample code.</p>
</body>
</html>